// import cinemas from "../router/cinemas.js";
import { request } from "../untils/request.js";
export default {
  get: ({ curPage, eachPage }) => request({
    type: "GET",
    url: "/api/cinemas",
    data: { curPage, eachPage },
  }),

  add: cinemas => request({
    type: "POST",
    url: "/api/cinemas",
    data: cinemas,
  }),
  remove: async removeData => {
    return await request({
      type: "POST",
      url: "/api/cinemas/remove",
      data: removeData,
    });
  },

  // 获取所有影院数据 排片用的
  getall: () =>
    request({
      type: "GET",
      url: "/api/cinemas/cinemasListAll",
    }),

  //获取影院的数据
  getData: () =>
    request({
      type: "GET",
      url: "/api/cinemas/getData",
    }),
 // 通过_id查找整条数据
 findOne: async _id =>
 await request({
     type: "GET",
     url: `/api/cinemas/findOne/${_id}`,
 }),
add:cinemas=>request({
 type:"POST",
 url:"/api/cinemas",
 data:cinemas,
}),
remove:async removeData=>{
 return await request({
     type:"POST",
 url:"/api/cinemas/remove",
 data:removeData,
 })
},
change: async (newData) => {
 return await request({
     type: "PUT",
     url: "/api/cinemas/change",
     data: newData,
 })
}
}
